<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * 审核数据模型
 *
 * Date: 22/03/2018
 * @author George
 * @package App\Models
 */
class Audit extends Model
{
	/**
	 * 定义不可填充字段
	 *
	 * @var array
	 * Date: 27/04/2018
	 * @author George
	 */
	protected $guarded = ['id'];

	/**
	 * 获取审核关联的模型
	 *
	 * Date: 24/04/2018
	 * @author George
	 * @return \Illuminate\Database\Eloquent\Relations\MorphTo
	 */
	public function auditable()
	{
		return $this->morphTo();
	}

	/**
	 * 获取审批人信息
	 *
	 * Date: 03/05/2018
	 * @author George
	 * @return \Illuminate\Database\Eloquent\Relations\MorphTo
	 */
	public function approver()
	{
		return $this->morphTo();
	}
}
